\HeaderA{VaR.norm}{Value at Risk Calculation in Lognormal Approximation}{VaR.norm}
\keyword{ts}{VaR.norm}
\begin{Description}\relax
This function estimates Value of Risk (VaR) value in lognormal approximation.
\end{Description}
\begin{Usage}
\begin{verbatim}
VaR.norm(ydat, p = 0.99, dt = 1, type = "long", drift.appx = FALSE, lin.appx = TRUE)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{ydat}] Numeric vector of data for which VaR is to be calculated
\item[\code{p}] Confidence level for VaR calculation
\item[\code{dt}] Liquidation period
\item[\code{type}] String describing type of VaR calculated: "long" or "short"
\item[\code{drift.appx}] Logical; if \code{TRUE} VaR is calculated in non-zero drift approximation 
\item[\code{lin.appx}] Logical; if \code{TRUE} VaR is calculated in linear approximation 
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
This function estimates VaR for a single risk factor \eqn{S(t)}{} in lognormal approximation. 
The final expression for VaR of {\bf long} and {\bf short} position is 
\deqn{VaR_{long}(c)=S(t)[1-exp(\mu \delta t + Q^{N(0,1)}_{1-c} \sigma \sqrt{\delta t})]}{}
\deqn{VaR_{short}(c)=-S(t)[1-exp(\mu \delta t - Q^{N(0,1)}_{1-c} \sigma \sqrt{\delta t})]}{}
Here, \eqn{c}{} is a desired confidence, \eqn{Q^{N(0,1)}_{1-c}}{} is a \eqn{1-c}{} percentile of normal
distribution, \eqn{\delta t}{} is liquidation period, and parameters \eqn{\mu}{} and \eqn{\sigma}{} are
mean value (or drift) and standard deviation of \eqn{\delta S(t)}{}.
If \code{drift.appx}=\code{FALSE}, \eqn{\mu = 0}{}. If \code{lin.appx}=\code{TRUE}, the above functions are expanded 
according \eqn{exp(x) = 1+x}{}.
\end{Details}
\begin{Value}
Return value is a list containing following components:
\begin{ldescription}
\item[\code{VaR}] Value at Risk for input data
\item[\code{data}] Input data
\item[\code{cdata}] Log-transformed data
\item[\code{liq.period}] Same as \code{dt}
\item[\code{type}] Same as \code{type}
\item[\code{conf.level}] Same as \code{p}
\item[\code{mean}] Mean value of \code{cdata}
\item[\code{std}] Standard deviation of \code{cdata}
\end{ldescription}
\end{Value}
\begin{Author}\relax
T. Daniyarov
\end{Author}
\begin{References}\relax
Deutsch, H.P., Derivatives and Internal Models, 2nd Edition, Palgrave, London 2001
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{VaR.norm.plots}{VaR.norm.plots}}, \code{\LinkA{VaR.backtest}{VaR.backtest}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
data(exchange.rates)
attach(exchange.rates)
y <- USDJPY[!is.na(USDJPY)]
z <- VaR.norm(y)
z$VaR
detach(exchange.rates)
\end{ExampleCode}
\end{Examples}

